import request from '@/utils/request'
import { downloadAction } from '@/api/requestEvents'

//获得项目计划分页
export function projectPlanPage(params: any) {
  return request({
    url: '/project/projectplan/project-plan/page',
    method: 'get',
    params,
  })
}

//获得项目计划详情
export function projectPlanGet(params: any) {
  return request({
    url: '/project/projectplan/project-plan/get',
    method: 'get',
    params,
  })
}

//创建项目计划
export function projectPlanCreate(data: any) {
  return request({
    url: '/project/projectplan/project-plan/create',
    method: 'post',
    data,
  })
}

//更新项目计划
export function projectPlanUpdate(data: any) {
  return request({
    url: '/project/projectplan/project-plan/update',
    method: 'put',
    data,
  })
}

//获得项目计划中的项目内容
export function projectPlanGetProject(params: any) {
  return request({
    url: '/project/projectplan/project-plan/getProject',
    method: 'get',
    params,
  })
}

//导出科技项目计划 Excel
export function projectPlanExport(params: any) {
  downloadAction(
    '/project/projectplan/project-plan/export-excel',
    'get',
    params,
    '科技项目计划列表.xls'
  )
}
